<div class="wrapper wrapper-content ">
  <div class="row">
    <div class="col-lg-12">
      <div class="ibox float-e-margins">
        <div class="ibox-title">
          <h5>用户注册

          </h5>
          <div ibox-tools></div>
        </div>
        <div class="ibox-content">
          <div class="row">
            <form class="form-horizontal form-label-left" name="userForm" ng-submit="register()">
              <div class="col-sm-5 b-r">

                <name-input></name-input>
                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    性别<span style="color: red; margin-left: 5px;">*</span>
                    <!--<br><span style="font-size:12px;color:gray; ">选择后不能修改</span>-->
                  </label>
                  <div class="col-sm-10" ng-class="{'has-success':!userForm.gender.$pristine && userForm.gender.$valid,'has-error':
(!userForm.gender.$pristine || userForm.gender.$touched) && userForm.gender.$invalid}">
                    <div class="col-sm-6">
                      <div class="radio" style="padding-left: 5px;">
                        <input type="radio" value="0" ng-model="user.gender" id="male" name="gender">
                        <label for="male" style="margin-top: 2px; padding-left: 0;">男</label>
                      </div>
                    </div>
                    <div class="col-sm-6">
                      <div class="radio">
                        <input type="radio" value="1" ng-model="user.gender" id="female" name="gender">
                        <label for="female" style="margin-top: 2px; padding-left: 0;">女</label>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    年龄<span style="color: red; margin-left: 5px;">*</span>
                    <!--<br><span style="font-size:1px;color:gray;">填后不能修改</span>-->
                  </label>
                  <div class="col-sm-10" ng-class="{'has-success':!userForm.age.$pristine && userForm.age.$valid,'has-error':
(!userForm.age.$pristine || userForm.age.$touched) && userForm.age.$invalid}">
                    <input type="number" name="age" class="form-control"
                           ng-model="user.age"
                           maxlength="3"
                           placeholder="填后不能修改"
                           ng-maxlength="3" required/>
                    <!--<span class="glyphicon glyphicon-ok form-control-feedback" style="padding:0 -10px; " ng-if="userForm.name.$dirty&&userForm.name.$valid"></span>-->
                    <!--<span class="glyphicon glyphicon-remove form-control-feedback" ng-if="userForm.name.$dirty&&userForm.name.$invalid"></span>-->
                    <div class="help-block" ng-messages="userForm.age.$error" ng-if="userForm.age.$touched">

                      <p ng-message="maxlength">年龄最大长度为3位</p>
                      <p ng-message="required">年龄必填</p>
                    </div>
                  </div>

                </div>

                <div class="form-group">
                  <label class="control-label col-sm-2">
                    出生日期<span style="color: red; margin-left: 5px;">*</span>
                  </label>
                  <div class="col-sm-10">
                    <div class="input-group date">
                      <input class="form-control" type="datetime" date-time
                             auto-close="true" min-view="date" format="YYYY-MM-DD" id="userdatabirthday"
                             ng-model="user.birthday" readonly>
                      <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    身份证<span style="color: red; margin-left: 5px;">*</span>
                    <!--<br><span style="font-size:1px;color:gray;">填后不能修改</span>-->
                  </label>
                  <div class="col-sm-10" ng-class="{'has-success':!userForm.IDcard.$pristine && userForm.IDcard.$valid,'has-error':
(!userForm.IDcard.$pristine || userForm.IDcard.$touched) && userForm.IDcard.$invalid}">
                    <input type="text" name="IDcard" class="form-control"
                           ng-model="user.IDcard"
                           ng-minlength="15"
                           maxlength="18"
                           placeholder="填后不能修改"
                           ng-maxlength="18" required/>
                    <!--<span class="glyphicon glyphicon-ok form-control-feedback" style="padding:0 -10px; " ng-if="userForm.name.$dirty&&userForm.name.$valid"></span>-->
                    <!--<span class="glyphicon glyphicon-remove form-control-feedback" ng-if="userForm.name.$dirty&&userForm.name.$invalid"></span>-->
                    <div class="help-block" ng-messages="userForm.IDcard.$error" ng-if="userForm.IDcard.$touched">
                      <p ng-message="minlength">身份证最小长度为15位</p>
                      <p ng-message="maxlength">身份证最大长度为18位</p>
                      <p ng-message="required">身份证号码必填</p>
                    </div>
                  </div>

                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    手机号码<span style="color: red; margin-left: 5px;">*</span>
                    <!--<br><span style="font-size:12px;color:gray;">填后不能修改</span>-->
                  </label>
                  <div class="col-sm-10" ng-class="{'has-success':!userForm.phoneNum.$pristine && userForm.phoneNum.$valid,'has-error':
(!userForm.phoneNum.$pristine || userForm.phoneNum.$touched) && userForm.phoneNum.$invalid}">
                    <input type="text" name="phoneNum" class="form-control"
                           ng-model="user.phoneNum"
                           maxlength="11"
                           ng-minlength="11"
                           placeholder="填后不能修改"
                           ng-maxlength="11" required/>
                    <!--<span class="glyphicon glyphicon-ok form-control-feedback" style="padding:0 -10px; " ng-if="userForm.name.$dirty&&userForm.name.$valid"></span>-->
                    <!--<span class="glyphicon glyphicon-remove form-control-feedback" ng-if="userForm.name.$dirty&&userForm.name.$invalid"></span>-->
                    <div class="help-block" ng-messages="userForm.phoneNum.$error" ng-if="userForm.phoneNum.$touched">
                      <p ng-message="minlength">手机号码最小长度为11位</p>
                      <p ng-message="maxlength">手机号码最大长度为11位</p>
                      <p ng-message="required">手机号码必填</p>
                    </div>
                  </div>

                </div>

                <div class="form-group">
                  <label class="control-label col-sm-2">
                    入院日期<span style="color: red; margin-left: 5px;">*</span>
                  </label>
                  <div class="col-sm-10">
                    <div class="input-group date">
                      <input class="form-control" type="datetime" date-time
                             auto-close="true" min-view="date" format="YYYY-MM-DD" id="visitHosipital"
                             ng-model="user.visitHosipital" readonly>
                      <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    入院病区<span style="color: red; margin-left: 5px;">*</span>
                  </label>
                  <div class="col-sm-10" ng-class="{'has-success':!userForm.position.$pristine && userForm.position.$valid,'has-error':
(!userForm.position.$pristine || userForm.position.$touched) && userForm.position.$invalid}">
                    <input type="text" name="position" class="form-control"
                           ng-model="user.position"


                           placeholder="填后不能修改"
                           required/>
                    <!--<span class="glyphicon glyphicon-ok form-control-feedback" style="padding:0 -10px; " ng-if="userForm.name.$dirty&&userForm.name.$valid"></span>-->
                    <!--<span class="glyphicon glyphicon-remove form-control-feedback" ng-if="userForm.name.$dirty&&userForm.name.$invalid"></span>-->
                    <div class="help-block" ng-messages="userForm.position.$error" ng-if="userForm.position.$touched">
                      <p ng-message="minlength">手机号码最小长度为11位</p>
                      <p ng-message="required">入院病区必填</p>
                    </div>
                  </div>

                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    病案号<span style="color: red; margin-left: 5px;">*</span>
                    <!--<br><span style="font-size:12px;color:gray;">门诊/住院病例号、床位号</span>-->
                  </label>
                  <div class="col-sm-10" ng-class="{'has-success':!userForm.caseNum.$pristine && userForm.caseNum.$valid,'has-error':
(!userForm.caseNum.$pristine || userForm.caseNum.$touched) && userForm.caseNum.$invalid}">
                    <input type="text" name="caseNum" class="form-control"
                           ng-model="user.caseNum"
                           ng-minlength=""
                           placeholder="门诊/住院病例号、床位号"
                           ng-maxlength="30" required/>
                    <!--<span class="glyphicon glyphicon-ok form-control-feedback" style="padding:0 -10px; " ng-if="userForm.name.$dirty&&userForm.name.$valid"></span>-->
                    <!--<span class="glyphicon glyphicon-remove form-control-feedback" ng-if="userForm.name.$dirty&&userForm.name.$invalid"></span>-->
                    <div class="help-block" ng-messages="userForm.caseNum.$error" ng-if="userForm.caseNum.$touched">
                      <!--<p ng-message="minlength">手机号码最小长度为11位</p>-->
                      <p ng-message="maxlength">病案号最大长度为30位</p>
                      <p ng-message="required">病案号必填</p>
                    </div>
                  </div>

                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    医保号<span style="color: red; margin-left: 5px;">*</span>
                    <!--<br><span style="font-size:12px;color:gray;">请填写医保号码</span>-->
                  </label>
                  <div class="col-sm-10" ng-class="{'has-success':!userForm.insuranceNum.$pristine && userForm.insuranceNum.$valid,'has-error':
(!userForm.insuranceNum.$pristine || userForm.insuranceNum.$touched) && userForm.insuranceNum.$invalid}">
                    <input type="text" name="insuranceNum" class="form-control"
                           ng-model="user.insuranceNum"
                           ng-minlength=""
                           placeholder="请填写医保号码"
                           ng-maxlength="30" required/>
                    <!--<span class="glyphicon glyphicon-ok form-control-feedback" style="padding:0 -10px; " ng-if="userForm.name.$dirty&&userForm.name.$valid"></span>-->
                    <!--<span class="glyphicon glyphicon-remove form-control-feedback" ng-if="userForm.name.$dirty&&userForm.name.$invalid"></span>-->
                    <div class="help-block" ng-messages="userForm.insuranceNum.$error"
                         ng-if="userForm.insuranceNum.$touched">
                      <!--<p ng-message="minlength">手机号码最小长度为11位</p>-->
                      <p ng-message="maxlength">医保号最大长度为30位</p>
                      <p ng-message="required">医保号必填</p>
                    </div>
                  </div>

                </div>

                <div class="form-group">

                  <label class="col-sm-2 control-label ">
                    费别 <span style="color: red; margin-left: 5px;">*</span><span class="help-block"
                                                                                 style="font-size:12px;color:gray; ">选择费用类型</span>
                  </label>
                  <div class="col-sm-10" ng-class="{'has-success':!userForm.payType.$pristine && userForm.payType.$valid,'has-error':
(!userForm.payType.$pristine || userForm.payType.$touched) && userForm.payType.$invalid}">
                    <select ng-model="user.payType" class="form-control"
                            ng-options="p.groupid as p.text for p in payments" name="payType" required>
                      <option value="" selected="selected">--请选择--</option>
                    </select>
                    <div class="help-block" ng-messages="userForm.payType.$error" ng-if="userForm.payType.$touched">
                      <!--<p ng-message="minlength">手机号码最小长度为11位</p>-->

                      <p ng-message="required">请选择分组</p>
                    </div>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label ">
                    部件 <span style="color: red; margin-left: 5px;">*</span><span class="help-block"
                                                                                 style="font-size:12px;color:gray; ">选择检查部位</span>
                  </label>
                  <div class="col-sm-10" ng-class="{'has-success':!userForm.diseasePart.$pristine && userForm.diseasePart.$valid,'has-error':
(!userForm.diseasePart.$pristine || userForm.diseasePart.$touched) && userForm.diseasePart.$invalid}">
                    <select ng-model="user.diseasePart" class="form-control"
                            ng-options="ta.groupid as ta.text for ta in treatedArea" name="diseasePart" required>
                      <option value="" selected="selected">--请选择--</option>
                    </select>
                    <div class="help-block" ng-messages="userForm.diseasePart.$error"
                         ng-if="userForm.diseasePart.$touched">
                      <!--<p ng-message="minlength">手机号码最小长度为11位</p>-->

                      <p ng-message="required">请选择分组</p>
                    </div>
                  </div>
                </div>


              </div>
              <div class="col-sm-5 b-r">


                <div class="form-group">

                  <label class="col-sm-2 control-label ">
                    婚姻状况
                  </label>
                  <div class="col-sm-10">
                    <select ng-model="user.marryStatus" class="form-control"
                            ng-options="p.groupid as p.text for p in marryStatus" name="marryStatus" required>
                      <option value="" selected="selected">--请选择--</option>
                    </select>

                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    民族
                  </label>
                  <div class="col-sm-10">
                    <input type="text" name="nation" class="form-control"
                           ng-model="user.nation"

                           ng-maxlength="10" required/>
                  </div>

                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    籍贯
                  </label>
                  <div class="col-sm-10">
                    <input type="text" name="nativePlace" class="form-control"
                           ng-model="user.nativePlace"

                           ng-maxlength="10" required/>
                  </div>

                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    职业
                  </label>
                  <div class="col-sm-10">
                    <input type="text" name="occupation" class="form-control"
                           ng-model="user.occupation"

                           ng-maxlength="10" required/>
                  </div>

                </div>

                <div class="form-group">
                  <label class="control-label col-sm-2 ">
                    出生地
                  </label>
                  <div class="col-sm-10 no-padding">
                    <div class="col-sm-4">
                      <select class="form-control selectpicker" data-width="auto" tabindex="-1"
                              ng-model="user.province"
                              id="userdetail-province" name="province"
                              data-parsley-multipleof="0" data-parsley-group="block1">
                        <option value="0">请选择省份</option>
                      </select>
                      <!-- <input type="text" name="province" class="form-control" id="userdetail-province"/> -->
                    </div>
                    <div class="col-sm-4">
                      <select class="form-control selectpicker" data-width="auto" tabindex="-1" ng-model="user.city"
                              id="userdetail-city" name="city" data-parsley-multipleof="0"
                              data-parsley-group="block1">
                        <option value="0">请选择城市</option>
                      </select>
                      <!-- <input type="text" name="city" class="form-control" id="userdetail-city"/> -->
                    </div>
                    <div class="col-sm-4">
                      <select class="form-control selectpicker" data-width="auto" tabindex="-1" ng-model="user.area"
                              id="userdetail-area" name="area" data-parsley-multipleof="0"
                              data-parsley-group="block1">
                        <option value="0">请选择区县</option>
                      </select>
                      <!--  <input type="text" name="area" class="form-control" id="userdetail-area"/> -->
                    </div>
                  </div>
                  <input type="hidden" value="0" id="pre_province"/>
                  <input type="hidden" value="0" id="pre_city"/>
                  <input type="hidden" value="0" id="pre_district"/>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    户口地址
                  </label>
                  <div class="col-sm-10">
                    <input type="text" name="address" class="form-control"
                           ng-model="user.address"

                           required/>
                  </div>

                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    联系电话
                  </label>
                  <div class="col-sm-10">
                    <input type="text" name="landline" class="form-control"
                           ng-model="user.landline"
                           required/>
                  </div>

                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    入院诊断
                  </label>
                  <div class="col-sm-10">
                        <textarea required="required"
                                  ng-model="user.diagnose" name="diagnose"
                                  class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required"
                                  rows="7"></textarea>
                  </div>

                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label">
                    ICD-10编码
                  </label>
                  <div class="col-sm-10">
                    <input type="text" name="ICDcode" class="form-control"
                           ng-model="user.ICDcode"

                           required/>
                  </div>

                </div>

                <div class="row">
                  <div class="col-sm-12">

                    <button class="btn btn-primary pull-right" id="createCard2" type="submit" ng-disabled="submit">注册
                    </button>
                    <button class="btn btn-primary pull-right" style="margin-right: 5px;" type="button"
                            ng-click="openForm()">表单预览
                    </button>
                    <button class="btn btn-primary pull-right" id="createCard3" type="button" ng-click="searchCase()"
                            style="margin-right: 5px;">病案号查询
                    </button>
                    <button class="btn btn-primary pull-right" id="createCard4" type="button"
                            style="margin-right: 5px;">二维码打印
                    </button>
                  </div>
                </div>

              </div>
              <div class="col-sm-2">
                <div class="pull-left col-sm-12 pointer" id="headimage" title="点击选择头像">
                  <div>
                    <img src="assets/images/register/default.png" ng-hide="!chooseImage" ng-click="openFile()"
                         ng-style="imageChange" class="pull-left imageChange">
                    <!--<input type="button"  class="btn btn-info" value="选择头像"  style="margin-left:10px;letter-spacing: 3px; z-index: 90;">-->
                  </div>
                  <img ng-src="{{imageSrc}}" ng-style="imageChange" class="pull-left imageChange"
                       ng-hide="chooseImage" ng-click="openFile()"/>
                  <input type="file" file-model="myFile" name="headpicfile" id="myfile"
                         style="margin: 10px;display: none" onchange="angular.element(this).scope().imageShow(this)"/>

                </div>
                <div class="pull-left col-sm-12 pointer" style="margin: 10px 0;">
                  <div>
                    <img src="assets/images/register/code.png" ng-hide="!chooseImage2" ng-style="imageChange"
                         class="pull-left imageChange" ng-click="printImage()">
                    <!--<input type="button" class="btn btn-info" value="打印二维码"  style="margin-left:10px; z-index: 90;">-->
                  </div>
                  <img ng-src="{{imageSrc1}}" ng-style="imageChange" class="pull-left imageChange"
                       ng-hide="chooseImage2" ng-click="printImage()"/>
                  <input type="file" file-model2="myFile2" id="mycode" name="headpicfile1"
                         style="margin: 10px;display: none" onchange="angular.element(this).scope().imageShow2(this)"/>

                </div>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>

  </div>

</div>

<toaster-container></toaster-container>
